package com.fary.context.annotation;

import com.fary.beans.factory.annotation.AnnotatedBeanDefinition;
import com.fary.beans.factory.support.GenericBeanDefinition;
import com.fary.core.type.AnnotationMetadata;
import com.fary.core.type.MethodMetadata;
import com.fary.core.type.classreading.MetadataReader;
import com.fary.util.Assert;

@SuppressWarnings("serial")
public class ScannedGenericBeanDefinition extends GenericBeanDefinition implements AnnotatedBeanDefinition {

	private final AnnotationMetadata metadata;

	public ScannedGenericBeanDefinition(MetadataReader metadataReader) {
		Assert.notNull(metadataReader, "MetadataReader must not be null");
		this.metadata = metadataReader.getAnnotationMetadata();
		setBeanClassName(this.metadata.getClassName());
	}


	@Override
	public final AnnotationMetadata getMetadata() {
		return this.metadata;
	}

	@Override
	public MethodMetadata getFactoryMethodMetadata() {
		return null;
	}

}